package com.nuoniu.sibanyun.entity.production;

import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * MRP运算主表
 * </p>
 *
 * @author 小啊刚
 * @since 2023-05-14
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ma_mrp_operation")
@ApiModel(value="MaMrpOperation对象", description="MRP运算主表")
public class MaMrpOperation extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "单据编号")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "单据日期")
    @TableField("voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate voucherDate;

    @ApiModelProperty(value = "MRP运算方案id")
    @TableField("choose_scheme_id")
    private Integer chooseSchemeId;

    @ApiModelProperty(value = "MRP运算方案名称")
    @TableField("choose_scheme_name")
    private String chooseSchemeName;

    @TableField("business_type")
    private Integer businessType;

    @ApiModelProperty(value = "单据来源（选择销售/预测订单,主生产计划）")
    @TableField("voucher_source")
    private String voucherSource;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "运算时间")
    @TableField("operation_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate operationDate;

    @ApiModelProperty(value = "提交人id")
    @TableField("submit_user_id")
    private Integer submitUserId;

    @ApiModelProperty(value = "提交人姓名")
    @TableField("submit_user_name")
    private String submitUserName;

    @ApiModelProperty(value = "提交日期")
    @TableField("submit_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime submitDate;

    @ApiModelProperty(value = "单据状态（应为审核状态）")
    @TableField("voucher_state")
    private Integer voucherState;

    @ApiModelProperty(value = "运算人ID")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "运算人名称")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "关闭人ID")
    @TableField("closer_id")
    private Integer closerId;

    @ApiModelProperty(value = "关闭人")
    @TableField("closer")
    private String closer;

    @ApiModelProperty(value = "关闭时间")
    @TableField("closed_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime closedDate;

    @ApiModelProperty(value = "关闭状态（0.未关闭，1.已关闭）")
    @TableField("closed_state")
    private Integer closedState;

    @ApiModelProperty(value = "运算状态（0.未运算，1.已运算）")
    @TableField("operation_state")
    private Integer operationState;

    @ApiModelProperty(value = "来源单据类型")
    @TableField("source_voucher_type")
    private String sourceVoucherType;

    @ApiModelProperty(value = "来源单据id")
    @TableField("source_voucher_id")
    private String sourceVoucherId;

    @TableField("source_voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm")
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "来源单据编号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "审核日期")
    @TableField("reviewer_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime reviewerDate;

    @ApiModelProperty(value = "审核人ID")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "审核人")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @TableField("closer_name")
    private String closerName;

    @ApiModelProperty(value = "累计执行数量")
    @TableField("cum_execute_quantity")
    private BigDecimal cumExecuteQuantity;

    @TableField("demand_priority")
    private String demandPriority;

    @TableField(exist = false)
    private List<MaMrpOperationDetail> maMrpOperationDetailList;


}
